package us.pigsoft.client;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.util.ArrayList;

public class GuiGame extends GuiElement {
	
	ArrayList<Mob> mobs;
	Player player;

	public GuiGame(int x, int y, Dimension size, Color outline, String id) {
		super(x, y, size, outline, id);
		mobs = new ArrayList<Mob>();
		player = new Player(this, new Dimension(32, 32));
		mobs.add(player);
		mobs.add(new Enemy(this, new Dimension(32, 32), Mob.AttackTypes.HOMING));
	}
	
	@Override
	public void pressed(boolean down) {
	}

	@Override
	public void click() {
	}

	@Override
	public void release() {
	}

	@Override
	public void entered(boolean in) {
	}

	@Override
	public void draw(Graphics2D g) {
		// Draw mobs
		for(Mob m : mobs)
		{
			m.draw(g);
		}
		
		// Draw projectiles
		for(Projectile p : Projectile.projectiles)
		{
			p.draw(g);
		}
	}

	@Override
	public void update() {
		// Update mobs
		for(Mob m : mobs)
		{
			m.update();
		}
		
		// Update projectiles
		for(Projectile p : Projectile.projectiles)
		{
			p.update();
		}
	}

	@Override
	public void keyPressed(char key) {
		
	}

}
